<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common.jsp"%>

<html lang="en">
<head>
    <meta charset="utf-8">
	<link href="${pageContext.request.contextPath}/resource/css/def/datatables/css/jquery.dataTables.min.css" rel="stylesheet">
	<link href="${pageContext.request.contextPath}/resource/css/def/ztree/metro.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/resource/css/def/bootstrap/css/bootstrap-upf.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/resource/css/def/bootstrap/ace/ace-part2.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/resource/css/def/bootstrap/ace/ace.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/resource/css/def/frm/common/common.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/resource/js/jquery/plugin/jquery.ztree.all-3.5.min.js"></script>
    <script src="${pageContext.request.contextPath}/resource/js/jquery/plugin/datatables/js/jquery.dataTables.js"></script>
	<script src="${pageContext.request.contextPath}/resource/js/jquery/plugin/handlebars-v3.0.1.js"></script>
	<script src="${pageContext.request.contextPath}/resource/js/frm/sys/sysRole.js"></script>
	<script type="text/javascript">
		var hadPermission = {'update':false,'del':false,'search':false};
		 <shiro:hasPermission name="sysRoleController/updateSysRole">
		 hadPermission.update =true;
		 </shiro:hasPermission>
	     <shiro:hasPermission name="sysRoleController/delSysRole">
		 hadPermission.del = true;
		 </shiro:hasPermission>
		 <shiro:hasPermission name="sysRoleController/searchStaff4Page">
		 hadPermission.search = true;
		 </shiro:hasPermission>
		 <shiro:hasPermission name="sys:role:getPerm">
		 hadPermission.search = true;
		 </shiro:hasPermission>
	</script>
	<style>
		.ma_contain{
			position:relative;
		}
		.ma_btn1{
			position:absolute;
			top:-36px;
			right:104px;
		}
		.ma_btn2,.ma_btn3{
			position:absolute;
			top:-36px;
			right:36px;
		}
		
	</style>
</head>
<body style="background-color:#fff;padding-top:20px;">
   
	
	
	<div class="container-fluid" id="searchContent">
		<div class="row">
			<form class="form-inline" method="post" id="sysRoleForm">
			<div class="input-group" style="margin-right:20px;">
    <span class="input-group-addon" for="sysRoleName">角色名:</span>
    <input type="text" class="form-control" name="sysRoleName" id="sysRoleName">
    </div>
				<shiro:hasPermission name="sysRoleController/search4Page">
				<a type="button" class="btn btn-info" onclick="serarch();" style="margin-right:10px;"><i class="ace-icon glyphicon glyphicon-search"></i>查询</a>
				</shiro:hasPermission>
				<shiro:hasPermission name="sysRoleController/addSysRole">
				<a type="button" class="btn btn-success" onclick="addRoleShow();"><i class="ace-icon glyphicon glyphicon-plus align-top bigger-125"></i>新增</a>
				</shiro:hasPermission>
			</form>
		 </div>
		<hr>
		
		<div class="row">
			<table id="searchTable" class="display table table-bordered" cellspacing="0" width="100%">
				<thead>
					<tr>
						<th>角色名</th>
						<th>所属部门</th>
						<th>操作</th>
					</tr>
				</thead>
			</table>
		</div>
	</div>
	
	<!-- 添加/修改 角色页面 -->
	<button style="display:none" id="showRole" data-toggle="modal" data-target="#roleModal"></button>
	<!-- class="modal fade" -->
	<div  id="roleModal" tabindex="-1" role="dialog" aria-labelledby="roleModalLabel" style="display:none;">
	<div class="col-xs-9 col-md-9">
			<div class="upfpanel-box ma_contain">
		<div class="upfpanel-header">
					<!-- <h5 class="upfpanel-title"><font style="color:red;">角色新增</font></h5> -->
					 <h5 class="upfpanel-title" style="color:red;">角色新增</h5> 
					<div class="upfpanel-toolbar">
						<div class="upfpanel-menu"></div>
					</div>
					
				</div><!-- end of upfpanel-header -->

		      <div class="modal-body">
		      	<form action="" class="form-horizontal" role="form" id="roleForm">
		      	  <input type="hidden" name="id" id="idRole" >
		      	   <div class="modal-footer">
			        <button type="button" class="btn btn-default ma_btn1"  id="closeAddModal" onclick="backSearch1();">返回</button> 
			        <button type="submit" class="btn btn-primary ma_btn2" name="addBtnName" style="display:none" id="addBtn">保存</button>
			        <button type="submit" class="btn btn-primary ma_btn3" style="display:none" id="updateBtn">修改</button>
			       </div> 
		      	  <div class="form-group">
				    <label for="name" class="col-sm-2 control-label">角色名称</label>
				    <div class="col-sm-10">
				      <input type="text" class="form-control" name="name" id="nameRole" placeholder="角色名称"  maxlength="20">
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="org_id" class="col-sm-2 control-label">所属部门</label>
				    <div class="col-sm-10">
				      <input type="text" class="form-control" placeholder="所属部门" data-toggle="modal" data-target="#orgModal"
				      	id="orgNameObj" readonly="readonly">
				      <input type="hidden" name="orgId" id="orgIdObj">
				    </div>
				  </div>
				 <div class="form-group">
				    <label for="org_id" class="col-sm-2 control-label">组织级别</label>
				   	 <div class="col-sm-10">
				     	<select class="form-control" name="controlLevel" id="controlLevelRoleObj" data-placeholder="选择组织级别">
													<option value="-1">无限制</option>
													<option value="100">集团公司</option>
													<option value="200">省公司</option>
													<option value="300">地市公司</option>
													<option value="400">区县公司</option>
						</select>
				    </div>
				  </div>
				  <div class="form-group">
				    <label class="col-sm-2 control-label">角色权限</label>
			    	<div class="col-sm-10">
			    		<ul id="permissionTree" class="ztree" style="width:560px; overflow:auto;"></ul>
			    	</div>
			    </div>
				</form>
			     </div>

			</div>
		</div>
	</div>

	
	
	
	<!-- 组织机构信息 -->
	<div class="modal fade" id="orgModal" tabindex="-1" role="dialog" aria-labelledby="orgModalLabel">
	  <div class="modal-dialog" role="document">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	        <h4 class="modal-title" id="orgModalLabel">组织机构信息</h4>
	      </div>
	      <div class="modal-body">
	        <ul id="orgTree" class="ztree" style="width:560px; overflow:auto;"></ul>
	      </div>
	      <div class="modal-footer">
	        <button type="button" class="btn btn-default" data-dismiss="modal" id="orgCloseModal">返回</button>
	      </div>
	    </div>
	  </div>
	</div>
	
	<!-- 角色信息 -->
	<div class="modal fade" id="permissionModal" tabindex="-1" role="dialog" aria-labelledby="permissionModalLabel">
	  <div class="modal-dialog" role="document">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	        <h4 class="modal-title" id="permissionModalLabel">角色信息</h4>
	      </div>
	      <div class="modal-body">
	        
	      </div>
	      <div class="modal-footer">
	        <button type="button" class="btn btn-default" data-dismiss="modal" id="permissionCloseModal" >返回</button>
	        <button type="button" class="btn btn-primary" onclick="permissionSelected();">确定</button>
	      </div>
	    </div>
	  </div>
	</div>
	
	<!-- 角色人员查看 -->
	<div class="container-fluid" id="RoleContainer" style="display:none;">
		<div class="row">
			<form class="form-inline" method="post" id="sysRoleForm">
				
				<a type="button"  class="btn btn-primary"  id="closeAddModal" onclick="backSearch();">返回</a>
			</form>
		</div>
		<hr>
		
		<div class="row">
  			<!-- 列表 -->
  			<table id="searchStaffTable" class="display" cellspacing="0" width="100%">
  				<thead>
  					<tr>
  						<th>id</th>
  						<th>人员编码</th>
  						<th>人员姓名</th>
  						<th>性别</th>
  						<th>电话号码</th>
  						<th>邮箱账号</th>
  						<th>手机号码</th>
  						<th>账号</th>
  						<th>人员状态</th>
  						<th>操作</th>
  					</tr>
  				</thead>
  				<tbody></tbody>
  			</table>
  		</div>
	</div>
</body>
</html>

	<%-- 
	  <!-- 1 开始 -->
	<div class="container-fluid">
		<!-- 2 查询form  id必须定义-->
		<form id="contentForm" name="contentForm" method="POST" action="search4PageList.do">
		<input name="name" value="">名称<br>
		<input name="start" value="1">
		<input name="length" value="2">
		</form>
		<!-- 3 局部刷新 -->
		<aa:zone name="countriesList">
			<table class="list_table table_fixed" cellspacing="0" cellpadding="0">
				<tr><th>名字</th><th>顺序号</th></tr>
			<c:forEach var="item" items="${page.list }" varStatus="status">
				<tr <c:if test="${status.count%2==0 }">class="table_bg"</c:if>><td>${item.name }</td><td>${status.count }</td></tr>
			</c:forEach>
			</table>
			
			<!-- 4 定义局部刷新区域的id -->
			<input type="" name="id_zone" value="countriesList">
			<!-- 5 定义局部刷新区域form的id -->
			<input type="" name="id_form" value="contentForm">
			<!-- 6  照抄 -->
			<%@ include file="/WEB-INF/jsp/frm/common/pageHelper.jsp"%>
		</aa:zone>
	</div><!--7  结束 -->
</body>
<script type="text/javascript">
		<!-- <button onclick="flushPage();">刷新</button> -->
/* ajaxAnywhere.formName = "contentForm";
ajaxAnywhere.getZonesToReload = function() {
	return "countriesList";
}
	function flushPage(){
		ajaxAnywhere.submitAJAX()
	} */

</script> --%>
</html>

